import * as obj from "../module/public.js";
import { ajax } from "../public/promiseAjax.js";
const o = obj.default;
import { Banner } from "../public/indexBanner.js";

; (async () => {
  const data = await ajax({
    url: 'http://localhost:3000/indexbanner',
    method: 'get',
  })
  const d = JSON.parse(data)
  d.filter((val) => {
    val.src = val.imgs
  })
  new Banner({
    box: o.$('.banner'),
    right: o.$('.right'),
    left: o.$('.left'),
    imgbox: o.$('.imgbox'),
    data: d,
    index: 2,
  })
}
)();


// .then(res => {
//   const data = JSON.parse(res)
//   data.filter((val) => {
//     val.src = val.imgs
//   }
//   )
// })

// import'../module/lazyLoad/a.js'
// <script src="../js/public/bannerMove.js" type="module"></script>
